//
//  YKViewVisitLogModelItemCell.m
//  YunKang
//
//  Created by leoking870 on 2017/10/1.
//  Copyright © 2017年 leoking870. All rights reserved.
//

#import "YKViewVisitLogItemCell.h"
#import "YKDashView.h"
@implementation YKViewVisitLogItemCell
@dynamic tableViewItem;
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)cellLoadSubViews {
    [super cellLoadSubViews];
    self.numberLabel.tf_weight = 5;
    self.salesmanLabel.tf_weight = 4;
    self.visitorDateLabel.tf_weight = 4;
    self.visitorLabel.tf_weight = 5;
    self.visitorDateLabel.textAlignment = NSTextAlignmentRight;
    [@[self.numberLabel, self.salesmanLabel,  self.visitorLabel,self.visitorDateLabel] mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.top.equalTo(self.contentView.mas_top).offset(11);
    }];
    
    [@[self.numberLabel, self.salesmanLabel,  self.visitorLabel,self.visitorDateLabel] mas_alignWeightlyAlongAxis:MASAxisTypeHorizontal
                                                                       fixedSpace:@8
                                                                        leadingTo:self.contentView.mas_leading
                                                                        leadSpace:13
                                                                       trailingTo:self.contentView.mas_trailing
                                                                        tailSpace:0];
    
    YKDashView* dashView = [[YKDashView alloc]init];
    dashView.lineWidth = .5f;
    dashView.lineColor = [UIColor tf_colorWithHexString:@"#d4d4d4"];
    dashView.dashLineLength = 3;
    [self addSubview:dashView];
    [dashView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.bottom.trailing.equalTo(self);
        make.height.mas_equalTo(1);
    }];
}

- (void)cellWillAppear {
    [super cellWillAppear];
    self.numberLabel.text = self.tableViewItem.model.VISITNO;
    self.salesmanLabel.text = self.tableViewItem.model.USER_NAME;
    self.visitorLabel.text = self.tableViewItem.model.VISITPERSON;
    self.visitorDateLabel.text = self.tableViewItem.model.VISITDATE;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
